#ifndef __THREAD_POOL_MANAGER__
#define __THREAD_POOL_MANAGER__

#include "IUtility.h"
#include "IThreadPoolManager.h"
#include "IPacket.h"
#include "TinyXml\tinyxml.h"

class CThreadPoolManager: public virtual IThreadManager
{
INIT_CLASS_SINGLETON(CThreadPoolManager)
public:
	
	bool CreateThreadPool(void * ptrThreadPoolPara);
	const bool AfterInit();
	void Start(const char * pszThreadPoolName)override final;
	void Stop(const char * pszThreadPoolName)override final;
	void Pause(const char * pszThreadPoolName)override final;
	int ThreadPoolState(const char * pszThreadPoolName)override final;
	const char * TriggerThreadPoolName(const char * pszThreadPoolName)override final;
	const char * TriggerName(const char * pszThreadPoolName)override final;
	void StartAllThread()override final;
	void StopAllThread()override final;
	void PauseAllThread()override final;

private:
	map< string, shared_ptr< IThreadPool > > m_mpThreadPoolContainer;

private:
	bool LoadThreaPara();
	bool ChkThreaPara(IPacket * ptrPktThreaPara, int iRecNo);
	bool CreateThreadPool(void * ptrPktThreaPara, int iRecNo);

};


#endif//__THREAD_POOL_MANAGER__